package com.moyang.learn.example190223hikaricp.rest;

import com.moyang.learn.example190223hikaricp.entity.User;
import com.moyang.learn.example190223hikaricp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户接口层
 *
 * @author fangjiaxiaobai@163.com
 * @time 2019-02-23
 */
@RestController
public class UserRest {

    @Autowired
    UserService userService;

    @GetMapping("getUser/{id}")
    public User getUser(@PathVariable String id) {
        User user = userService.getUser(id);
        return user;
    }

}
